home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / cscal3d.z / cscal3d
Encoding:
Text File  |  1998-10-30  |  7.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ccccssssccccaaaallll3333dddd,,,,zzzzssssccccaaaallll3333dddd((((3333FFFF))))                                        ccccssssccccaaaallll3333dddd,,,,zzzzssssccccaaaallll3333dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ccccssssccccaaaallll3333dddd,,,, zzzzssssccccaaaallll3333dddd ---- scales a 3D complex sequence.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccssssccccaaaallll3333dddd(((( nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllaaaa1111,,,, llllaaaa2222))))
  14.           iiiinnnntttteeeeggggeeeerrrr     nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, llllaaaa1111,,,, llllaaaa2222
  15.           rrrreeeeaaaallll        aaaallllpppphhhhaaaa
  16.           ccccoooommmmpppplllleeeexxxx     aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  17.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzssssccccaaaallll3333dddd(((( nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllaaaa1111,,,, llllaaaa2222))))
  18.           iiiinnnntttteeeeggggeeeerrrr     nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, llllaaaa1111,,,, llllaaaa2222
  19.           rrrreeeeaaaallll****8888      aaaallllpppphhhhaaaa
  20.           ddddoooouuuubbbblllleeee ccccoooommmmpppplllleeeexxxx aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  21.  
  22.      _C :
  23.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  24.      iiiinnnntttt ccccssssccccaaaallll3333dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,,ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,,
  25.                ccccoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222))));;;;
  26.      iiiinnnntttt zzzzssssccccaaaallll3333dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,,ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,,
  27.                zzzzoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222))));;;;
  28.  
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      ccccssssccccaaaallll3333dddd and zzzzssssccccaaaallll3333dddd scale a 3D complex sequence of size N1xN2xN3.
  32.      The Fourier Transforms are not normalized so the succession Direct-
  33.      Inverse transform scales the input data by a factor equal to the size of
  34.      the transform.  So ccccssssccccaaaallll3333dddd or zzzzssssccccaaaallll3333dddd may be used to scale back the
  35.      result.
  36.  
  37. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  38.      NNNN1111 Integer, the first dimension size of the 3D sequence.  Unchanged on
  39.      exit.
  40.  
  41.      NNNN2222 Integer, the second dimension size of the 3D sequence.  Unchanged on
  42.      exit.
  43.  
  44.      NNNN3333 Integer, the thrid dimension size of the 3D sequence.  Unchanged on
  45.      exit.
  46.  
  47.      AAAAllllpppphhhhaaaa scaling floating point value.
  48.  
  49.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the 3D sequence to be transformed.
  50.      On input, the element {i,j,k} of the sequence is stored as A(i,j,k) in
  51.      _F_o_r_t_r_a_n , and A[i+j*la1+k*la1*la2] in _C.
  52.      On exit, the array is overwritten.
  53.  
  54.      LLLLAAAA1111 Integer, first leading dimension: increment between the samples of
  55.      two consecutive 1D sub-sequences (e.g between {i,j+1,k} and {i,j,k} ).
  56.      Unchanged on exit.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccssssccccaaaallll3333dddd,,,,zzzzssssccccaaaallll3333dddd((((3333FFFF))))                                        ccccssssccccaaaallll3333dddd,,,,zzzzssssccccaaaallll3333dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      LLLLAAAA2222 Integer, second leading dimension: number of the 1D sub-sequence
  75.      between two consecutive 2D sub-sequences (e.g between {i,j,k+1} and
  76.      {i,j,k}).  Unchanged on exit.
  77.  
  78.  
  79. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  80.      Given a 3D complex sequence of size 100x64x125.  We successively apply a
  81.      Direct Fourier Transform, an Inverse Fourier Transform and finally scale
  82.      back the result by a factor 1/N (1/(100x64x125))-
  83.      This succession DirectFFT-InverseFFT-Scaling is equivalent to the
  84.      identity operator and the final sequence should be equal (with round-off
  85.      precision) to the initial sequence.
  86.      The offset between the first element of two succesive sub-sequence
  87.      (leading dimension) is 2049.
  88.      _F_o_r_t_r_a_n
  89.           complex array(0:100-1,0:64-1,0:125-1)
  90.           real alpha
  91.           complex filter(0:100-1,0:64-1,0:125-1),
  92.           complex coeff(100+15 + 64+15 + 125+15)
  93.           call cfft3di( 100, 64, 125, coeff)
  94.           call cfft3d( -1,100,64,125,array,100,64,coeff)
  95.           call cfft3d(  1,100,64,125,array,100,64,coeff)
  96.           alpha = 1. / real(100x64x125)
  97.           call cscal3d( 100,64,125,alpha,array,100,64)
  98.  
  99.      _C
  100.           #include <fft.h>
  101.           complex array[100*64*125], *coeff;
  102.           float alpha;
  103.           coeff = cfft3di( 100, 64, 125, NULL);
  104.           cfft3d( -1,100,64,125,array,100,64,coeff);
  105.           cfft3d(  1,100,64,125,array,100,64,coeff);
  106.           alpha = 1. / (float)(100x64x125)
  107.           cscal3d( 100,64,125,alpha,array,100,64)
  108.  
  109.      NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
  110.      Which one is used (+1 or -1) for Direct transform is just a matter of
  111.      convention-
  112.  
  113.      NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
  114.      Direct-Inverse transform scales the input data by a factor equal to the
  115.      size of the transform.
  116.  
  117. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  118.      fft, cfft3di, zfft3di, cfft3d, zfft3d, cprod3d, zprod3d
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.